﻿namespace Hotel.Web.Models
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public class RoomCleaner
    {
        public List<Assignment> Assignments { get; set; }
        public List<string> RoomNumbers { get; set; }
        public string SelectedRoom { get; set; }

        public static RoomCleaner FromDomainModel(List<Hotel.Module.Management.Models.Assignment> ass)
        {
            RoomCleaner rc = new RoomCleaner();
            rc.Assignments = new List<Assignment>();
            rc.RoomNumbers = new List<string>();
            foreach (var item in ass)
            {
                Assignment a = Assignment.FromDomainModel(item);
                rc.Assignments.Add(a);
                string value = string.Format("{0} {1} {2}", "Room", a.RoomNumber.ToString(), a.CurrentService.Name);
                rc.RoomNumbers.Add(value);
            }
            return rc;
        }
    }
}